Optimal. Leaf size=85 \[ \frac{2 i a^3 \tan (c+d x)}{d}-\frac{4 a^3 \log (\cos (c+d x))}{d}-4 i a^3 x+\frac{a (a+i a \tan (c+d x))^2}{2 d}+\frac{(a+i a \tan (c+d x))^3}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0576672, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3527, 3478, 3477, 3475} \[ \frac{2 i a^3 \tan (c+d x)}{d}-\frac{4 a^3 \log (\cos (c+d x))}{d}-4 i a^3 x+\frac{a (a+i a \tan (c+d x))^2}{2 d}+\frac{(a+i a \tan (c+d x))^3}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3527
Rule 3478
Rule 3477
Rule 3475
Rubi steps
\begin{align*} \int \tan (c+d x) (a+i a \tan (c+d x))^3 \, dx &=\frac{(a+i a \tan (c+d x))^3}{3 d}-i \int (a+i a \tan (c+d x))^3 \, dx\\ &=\frac{a (a+i a \tan (c+d x))^2}{2 d}+\frac{(a+i a \tan (c+d x))^3}{3 d}-(2 i a) \int (a+i a \tan (c+d x))^2 \, dx\\ &=-4 i a^3 x+\frac{2 i a^3 \tan (c+d x)}{d}+\frac{a (a+i a \tan (c+d x))^2}{2 d}+\frac{(a+i a \tan (c+d x))^3}{3 d}+\left (4 a^3\right ) \int \tan (c+d x) \, dx\\ &=-4 i a^3 x-\frac{4 a^3 \log (\cos (c+d x))}{d}+\frac{2 i a^3 \tan (c+d x)}{d}+\frac{a (a+i a \tan (c+d x))^2}{2 d}+\frac{(a+i a \tan (c+d x))^3}{3 d}\\ \end{align*}
Mathematica [B] time = 1.13465, size = 178, normalized size = 2.09 \[ -\frac{i a^3 \sec (c) \sec ^3(c+d x) \left (15 \sin (2 c+d x)-13 \sin (2 c+3 d x)+6 d x \cos (2 c+3 d x)+6 d x \cos (4 c+3 d x)-3 i \cos (2 c+3 d x) \log \left (\cos ^2(c+d x)\right )+9 \cos (d x) \left (-i \log \left (\cos ^2(c+d x)\right )+2 d x-i\right )+9 \cos (2 c+d x) \left (-i \log \left (\cos ^2(c+d x)\right )+2 d x-i\right )-3 i \cos (4 c+3 d x) \log \left (\cos ^2(c+d x)\right )-24 \sin (d x)\right )}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.003, size = 85, normalized size = 1. \begin{align*}{\frac{4\,i{a}^{3}\tan \left ( dx+c \right ) }{d}}-{\frac{{\frac{i}{3}}{a}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{3}}{d}}-{\frac{3\,{a}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,d}}+2\,{\frac{{a}^{3}\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{d}}-{\frac{4\,i{a}^{3}\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 2.00956, size = 93, normalized size = 1.09 \begin{align*} -\frac{2 i \, a^{3} \tan \left (d x + c\right )^{3} + 9 \, a^{3} \tan \left (d x + c\right )^{2} + 24 i \,{\left (d x + c\right )} a^{3} - 12 \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 24 i \, a^{3} \tan \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.22603, size = 370, normalized size = 4.35 \begin{align*} -\frac{2 \,{\left (24 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 13 \, a^{3} + 6 \,{\left (a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{3 \,{\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 5.55981, size = 136, normalized size = 1.6 \begin{align*} - \frac{4 a^{3} \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac{- \frac{16 a^{3} e^{- 2 i c} e^{4 i d x}}{d} - \frac{22 a^{3} e^{- 4 i c} e^{2 i d x}}{d} - \frac{26 a^{3} e^{- 6 i c}}{3 d}}{e^{6 i d x} + 3 e^{- 2 i c} e^{4 i d x} + 3 e^{- 4 i c} e^{2 i d x} + e^{- 6 i c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.38674, size = 230, normalized size = 2.71 \begin{align*} -\frac{2 \,{\left (6 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 18 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 18 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 13 \, a^{3}\right )}}{3 \,{\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]